package org.cbg.panel;

import java.awt.Dimension;
import java.awt.Graphics;
import java.io.File;
import java.io.IOException;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

import org.cbg.btn.TrslationMainBtn;

import com.tool.btn.FormsOnOffBtn;



/**
 * 藏宝阁主面板
 * 
 * @author Administrator
 * 
 */

public class TrslationTreasurepavilionJpanel extends JPanel {

    /**
     * 卡片布局面板
     */
    private TranslationMainCardJpanel translationMainCardJpanel;

    /**
     * 我要买，我要卖，我的藏宝阁，消息
     */
    private TrslationMainBtn iwantbuy, iwantsent, icangbaoge, imes;

    public TrslationTreasurepavilionJpanel() {
        this.setPreferredSize(new Dimension(800, 550));
        this.setLayout(null);
        this.setOpaque(false);


        translationMainCardJpanel = new TranslationMainCardJpanel();
        this.add(translationMainCardJpanel);
        iwantbuy = new TrslationMainBtn("inkImg/number/b4/wyma.png", 1, 1, this);
        iwantbuy.setBounds(45, 26, 99, 31);

        iwantsent = new TrslationMainBtn("inkImg/number/b4/wymb1.png", 1, 2, this);
        iwantsent.setBounds(45 + 110, 26, 99, 31);

        icangbaoge = new TrslationMainBtn("inkImg/number/b4/wdcbg1.png", 1, 3, this);
        icangbaoge.setBounds(45 + 110 * 2, 26, 138, 31);

        imes = new TrslationMainBtn("inkImg/number/b4/xx1.png", 1, 4, this);
        imes.setBounds(45+ 39+ 110 * 3, 26, 99, 31);

        FormsOnOffBtn guanbi = new FormsOnOffBtn("inkImg/number/b4/gift-close-btn.png", 1, 78);
        guanbi.setBounds(800 - 28, 6, 18, 18);
        this.add(guanbi);
        this.add(iwantbuy);
        this.add(icangbaoge);
        this.add(imes);
        this.add(iwantsent);
    }

    private ImageIcon icon1;

    @Override
    protected void paintComponent(Graphics g) {
        // TODO Auto-generated method stub
        super.paintComponent(g);

        if (icon1 == null) {
//            icon1 = new ImageIcon(imageMap.getImgMap().get("wymb1"),""+ 1000 +".png");
            icon1 = new ImageIcon("inkImg/number/b4/cbg.png");

        }
        g.drawImage(icon1.getImage(), 0, 0, 800, 550, this);

    }

    public TranslationMainCardJpanel getTranslationMainCardJpanel() {
        return translationMainCardJpanel;
    }

    public void setTranslationMainCardJpanel(TranslationMainCardJpanel translationMainCardJpanel) {
        this.translationMainCardJpanel = translationMainCardJpanel;
    }

    public TrslationMainBtn getIwantbuy() {
        return iwantbuy;
    }

    public void setIwantbuy(TrslationMainBtn iwantbuy) {
        this.iwantbuy = iwantbuy;
    }

    public TrslationMainBtn getIwantsent() {
        return iwantsent;
    }

    public void setIwantsent(TrslationMainBtn iwantsent) {
        this.iwantsent = iwantsent;
    }

    public TrslationMainBtn getIcangbaoge() {
        return icangbaoge;
    }

    public void setIcangbaoge(TrslationMainBtn icangbaoge) {
        this.icangbaoge = icangbaoge;
    }

    public TrslationMainBtn getImes() {
        return imes;
    }

    public void setImes(TrslationMainBtn imes) {
        this.imes = imes;
    }

    public ImageIcon getIcon1() {
        return icon1;
    }

    public void setIcon1(ImageIcon icon1) {
        this.icon1 = icon1;
    }

}
